home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / TUTORIAL.BIN / SplitterPanel.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-12-16  |  15.5 KB  |  1,040 lines

  1. package symantec.itools.awt;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Dimension;
  7. import java.awt.Event;
  8. import java.awt.Frame;
  9. import java.awt.Graphics;
  10. import java.awt.LayoutManager;
  11. import java.awt.Panel;
  12. import java.awt.Point;
  13. import java.awt.Rectangle;
  14.  
  15. public class SplitterPanel extends Panel {
  16.    public static final int SPLIT_VER = 1;
  17.    public static final int SPLIT_HOR = 2;
  18.    public static final int SPLIT_VERTICAL = 1;
  19.    public static final int SPLIT_HORIZONTAL = 2;
  20.    public static final int SPLIT_BOTH = 3;
  21.    public static final int SPLIT_BOTH_V = 4;
  22.    public static final int SPLIT3_LEFT = 5;
  23.    public static final int SPLIT3_RIGHT = 6;
  24.    public static final int SPLIT3_TOP = 7;
  25.    public static final int SPLIT3_BOTTOM = 8;
  26.    private static final int SPLIT_NONE = 0;
  27.    public boolean use3dBdr;
  28.    private boolean enforceMinDim;
  29.    private boolean propResize;
  30.    public int moveSplitCursor;
  31.    private int splitType;
  32.    private boolean isOuter;
  33.    private Dimension curDim;
  34.    private Point curLoc;
  35.    private boolean dimChanged;
  36.    private boolean heightOnly;
  37.    private boolean widthOnly;
  38.    private boolean doMoveSplit;
  39.    private boolean cursorChanged;
  40.    private int moveFromX;
  41.    private int moveFromY;
  42.    private Component spComponent;
  43.    private SplitterPanel sub1;
  44.    private SplitterPanel sub2;
  45.    private SplitterPanel innerSP;
  46.    private SplitterPanel outerSP;
  47.    private Dimension minDim;
  48.    private Dimension prefDim;
  49.    private Color gapColor;
  50.    private int iGapWidth;
  51.    private int iGapHeight;
  52.    private int oGapWidth;
  53.    private int oGapHeight;
  54.    private int iBdrSize;
  55.    private int oBdrSize;
  56.    private boolean bOsFlag;
  57.  
  58.    public SplitterPanel() {
  59.       this(true);
  60.    }
  61.  
  62.    public SplitterPanel(int var1, int var2) {
  63.       this(true);
  64.       if (this != null) {
  65.          ((Component)this).resize(var1, var2);
  66.       }
  67.    }
  68.  
  69.    public SplitterPanel(int var1, int var2, int var3) {
  70.       this(var3);
  71.       if (this != null) {
  72.          ((Component)this).resize(var1, var2);
  73.       }
  74.    }
  75.  
  76.    public SplitterPanel(int var1) {
  77.       this(var1, (Component)null, (Component)null, (Component)null, (Component)null);
  78.    }
  79.  
  80.    public SplitterPanel(int var1, Component var2, Component var3, Component var4, Component var5) {
  81.       this(true);
  82.       if (this != null) {
  83.          switch (var1) {
  84.             case 0:
  85.                if (var2 != null) {
  86.                   ((Container)this).add(var2);
  87.                   return;
  88.                }
  89.             default:
  90.                return;
  91.             case 1:
  92.                this.split(1, var2, var3);
  93.                return;
  94.             case 2:
  95.                this.split(2, var2, var4);
  96.                return;
  97.             case 3:
  98.                this.split(2);
  99.                this.getSubPanel(1).split(1, var2, var3);
  100.                this.getSubPanel(2).split(1, var4, var5);
  101.                return;
  102.             case 4:
  103.                this.split(1);
  104.                this.getSubPanel(1).split(2, var2, var4);
  105.                this.getSubPanel(2).split(2, var3, var5);
  106.                return;
  107.             case 5:
  108.                this.split(1, (Component)null, var3);
  109.                this.getSubPanel(1).split(2, var2, var4);
  110.                return;
  111.             case 6:
  112.                this.split(1, var2, (Component)null);
  113.                this.getSubPanel(2).split(2, var3, var5);
  114.                return;
  115.             case 7:
  116.                this.split(2, (Component)null, var4);
  117.                this.getSubPanel(1).split(1, var2, var3);
  118.                return;
  119.             case 8:
  120.                this.split(2, var2, (Component)null);
  121.                this.getSubPanel(2).split(1, var4, var5);
  122.          }
  123.       }
  124.    }
  125.  
  126.    private SplitterPanel(boolean var1) {
  127.       this.use3dBdr = true;
  128.       this.enforceMinDim = false;
  129.       this.propResize = true;
  130.       this.moveSplitCursor = 13;
  131.       this.doMoveSplit = false;
  132.       this.cursorChanged = false;
  133.       this.isOuter = var1;
  134.       this.dimChanged = true;
  135.       this.heightOnly = false;
  136.       this.widthOnly = false;
  137.       this.splitType = 0;
  138.       this.setLayout((LayoutManager)null);
  139.       this.minDim = new Dimension(0, 0);
  140.       this.curDim = new Dimension(0, 0);
  141.       this.curLoc = new Point(0, 0);
  142.       this.prefDim = new Dimension(0, 0);
  143.       this.gapColor = Color.lightGray;
  144.       this.iGapWidth = 3;
  145.       this.iGapHeight = 3;
  146.       this.iBdrSize = 2;
  147.       this.oGapWidth = 3;
  148.       this.oGapHeight = 3;
  149.       this.oBdrSize = 2;
  150.       if (var1) {
  151.          this.innerSP = new SplitterPanel(false);
  152.          super.add(this.innerSP, -1);
  153.          this.outerSP = this;
  154.          this.innerSP.outerSP = this;
  155.       }
  156.  
  157.    }
  158.  
  159.    public void setGapColor(Color var1) {
  160.       this.gapColor = new Color(var1.getRed(), var1.getGreen(), var1.getBlue());
  161.       this.propagateChanges();
  162.    }
  163.  
  164.    public Color getGapColor() {
  165.       return this.gapColor;
  166.    }
  167.  
  168.    private void adjustOGapBdr() {
  169.       if (this.oGapWidth < this.oBdrSize) {
  170.          this.oGapWidth = Math.max(0, this.oBdrSize);
  171.       }
  172.  
  173.       if (this.oGapHeight < this.oBdrSize) {
  174.          this.oGapHeight = Math.max(0, this.oBdrSize);
  175.       }
  176.  
  177.    }
  178.  
  179.    public void setGapSizes(int var1) {
  180.       this.iGapWidth = var1;
  181.       this.iGapHeight = var1;
  182.       this.oGapWidth = var1;
  183.       this.oGapHeight = var1;
  184.       this.adjustOGapBdr();
  185.       this.propagateChanges();
  186.       ((Component)this).invalidate();
  187.    }
  188.  
  189.    public void setGapSizes(int var1, int var2) {
  190.       this.iGapWidth = var1;
  191.       this.iGapHeight = var2;
  192.       this.oGapWidth = var1;
  193.       this.oGapHeight = var2;
  194.       this.adjustOGapBdr();
  195.       this.propagateChanges();
  196.       ((Component)this).invalidate();
  197.    }
  198.  
  199.    public void setGapSizes(int var1, int var2, int var3, int var4) {
  200.       this.iGapWidth = var1;
  201.       this.iGapHeight = var2;
  202.       this.oGapWidth = var3;
  203.       this.oGapHeight = var4;
  204.       this.adjustOGapBdr();
  205.       this.propagateChanges();
  206.       ((Component)this).invalidate();
  207.    }
  208.  
  209.    public void setBdrSizes(int var1, int var2) {
  210.       this.iBdrSize = var1;
  211.       this.oBdrSize = var2;
  212.       this.adjustOGapBdr();
  213.       this.propagateChanges();
  214.       ((Component)this).invalidate();
  215.    }
  216.  
  217.    public void setBdrSizes(int var1) {
  218.       this.iBdrSize = var1;
  219.       this.oBdrSize = var1;
  220.       this.adjustOGapBdr();
  221.       this.propagateChanges();
  222.       ((Component)this).invalidate();
  223.    }
  224.  
  225.    public Color gapColor() {
  226.       return this.gapColor;
  227.    }
  228.  
  229.    public void setEnforceMinDim(boolean var1) {
  230.       this.enforceMinDim = var1;
  231.       this.propagateChanges();
  232.    }
  233.  
  234.    public boolean getEnforceMinDim() {
  235.       return this.enforceMinDim;
  236.    }
  237.  
  238.    public void setPropResize(boolean var1) {
  239.       this.propResize = var1;
  240.       this.propagateChanges();
  241.    }
  242.  
  243.    public boolean getPropResize() {
  244.       return this.propResize;
  245.    }
  246.  
  247.    public int getSplitType() {
  248.       SplitterPanel var1 = this;
  249.       if (this.isOuter) {
  250.          var1 = this.innerSP;
  251.       }
  252.  
  253.       return var1.splitType;
  254.    }
  255.  
  256.    public SplitterPanel getSubPanel(int var1) {
  257.       SplitterPanel var2 = this;
  258.       if (this.isOuter) {
  259.          var2 = this.innerSP;
  260.       }
  261.  
  262.       if (var1 == 1) {
  263.          return var2.sub1;
  264.       } else {
  265.          return var1 == 2 ? var2.sub2 : null;
  266.       }
  267.    }
  268.  
  269.    public SplitterPanel getSubPanel(int var1, int var2) {
  270.       return this.getSplitType() == var2 ? this.getSubPanel(var1) : null;
  271.    }
  272.  
  273.    public SplitterPanel getSub2Panel(int var1, int var2, int var3, int var4) {
  274.       SplitterPanel var5 = this.getSubPanel(var1, var2);
  275.       return var5 != null ? var5.getSubPanel(var3, var4) : null;
  276.    }
  277.  
  278.    public SplitterPanel getTopPanel() {
  279.       return this.getSubPanel(1, 2);
  280.    }
  281.  
  282.    public SplitterPanel getBottomPanel() {
  283.       return this.getSubPanel(2, 2);
  284.    }
  285.  
  286.    public SplitterPanel getLeftPanel() {
  287.       return this.getSubPanel(1, 1);
  288.    }
  289.  
  290.    public SplitterPanel getRightPanel() {
  291.       return this.getSubPanel(2, 1);
  292.    }
  293.  
  294.    public SplitterPanel getTopLeftPanel() {
  295.       return this.getSplitType() == 2 ? this.getSub2Panel(1, 2, 1, 1) : this.getSub2Panel(1, 1, 1, 2);
  296.    }
  297.  
  298.    public SplitterPanel getTopRightPanel() {
  299.       return this.getSplitType() == 2 ? this.getSub2Panel(1, 2, 2, 1) : this.getSub2Panel(2, 1, 1, 2);
  300.    }
  301.  
  302.    public SplitterPanel getBottomLeftPanel() {
  303.       return this.getSplitType() == 2 ? this.getSub2Panel(2, 2, 1, 1) : this.getSub2Panel(1, 1, 2, 2);
  304.    }
  305.  
  306.    public SplitterPanel getBottomRightPanel() {
  307.       return this.getSplitType() == 2 ? this.getSub2Panel(2, 2, 2, 1) : this.getSub2Panel(2, 1, 2, 2);
  308.    }
  309.  
  310.    public boolean handleEvent(Event var1) {
  311.       if (var1.target == this && this.isOuter) {
  312.          return this.oGapThis(var1);
  313.       } else {
  314.          switch (var1.id) {
  315.             case 501:
  316.                if (var1.target == this && this.splitType == 2 && this.outerSP.cursorChanged) {
  317.                   this.doMoveSplit = true;
  318.                   this.moveFromX = var1.x;
  319.                   this.moveFromY = var1.y;
  320.                   return true;
  321.                } else if (var1.target == this && this.splitType == 1 && this.outerSP.cursorChanged) {
  322.                   this.doMoveSplit = true;
  323.                   this.moveFromX = var1.x;
  324.                   this.moveFromY = var1.y;
  325.                   return true;
  326.                }
  327.             case 506:
  328.                if (this.doMoveSplit) {
  329.                   return true;
  330.                }
  331.             case 502:
  332.                if (this.doMoveSplit) {
  333.                   this.moveSplit(var1.x - this.moveFromX, var1.y - this.moveFromY);
  334.                   this.doMoveSplit = false;
  335.                   return true;
  336.                }
  337.             case 504:
  338.             case 505:
  339.             default:
  340.                return super.handleEvent(var1);
  341.             case 503:
  342.                if (var1.target == this && this.splitType == 2 && this.inGap1(var1.x, var1.y)) {
  343.                   this.setCursor(this.moveSplitCursor);
  344.                   return true;
  345.                } else if (var1.target == this && this.splitType == 1 && this.inGap1(var1.x, var1.y)) {
  346.                   this.setCursor(this.moveSplitCursor);
  347.                   return true;
  348.                } else {
  349.                   if (!this.doMoveSplit && !this.inGap(var1)) {
  350.                      this.resetCursor();
  351.                   }
  352.  
  353.                   return true;
  354.                }
  355.          }
  356.       }
  357.    }
  358.  
  359.    public int iGapWidth() {
  360.       return this.iGapWidth;
  361.    }
  362.  
  363.    public int iGapHeight() {
  364.       return this.iGapHeight;
  365.    }
  366.  
  367.    public int oGapWidth() {
  368.       return this.oGapWidth;
  369.    }
  370.  
  371.    public int oGapHeight() {
  372.       return this.oGapHeight;
  373.    }
  374.  
  375.    public int iBdrSize() {
  376.       return this.iBdrSize;
  377.    }
  378.  
  379.    public int oBdrSize() {
  380.       return this.oBdrSize;
  381.    }
  382.  
  383.    private int optSize(int var1, int var2, int var3, int var4, int var5, int var6) {
  384.       int var9 = Math.max(var2, 0);
  385.       int var10 = Math.max(var3, 1);
  386.       int var11 = Math.max(var4, 1);
  387.       int var12 = Math.max(var5, var10);
  388.       int var13 = Math.max(var6, var11);
  389.       int var7 = var1 - (var12 + var13 + var9);
  390.       if (var7 >= 0) {
  391.          float var16 = (float)var12 / (float)(var12 + var13);
  392.          return var12 + (int)((float)var7 * var16);
  393.       } else {
  394.          var7 = var1 - (var10 + var11 + var9);
  395.          if (var7 >= 0) {
  396.             float var15 = (float)var12 / (float)(var12 + var13);
  397.             return var10 + (int)((float)var7 * var15);
  398.          } else if (var1 > var9) {
  399.             float var8 = (float)var10 / (float)(var10 + var11);
  400.             return var10 + (int)((float)var7 * var8);
  401.          } else {
  402.             return var1;
  403.          }
  404.       }
  405.    }
  406.  
  407.    public synchronized void layout() {
  408.       this.placeComponents();
  409.    }
  410.  
  411.    private void placeComponents() {
  412.       Rectangle var13 = new Rectangle(this.curLoc.x, this.curLoc.y, this.curDim.width, this.curDim.height);
  413.       if (this.isOuter) {
  414.          int var16 = this.oGapWidth + this.oBdrSize;
  415.          int var18 = this.oGapHeight + this.oBdrSize;
  416.          int var20 = var13.width - (2 * this.oGapWidth + this.oBdrSize + 1);
  417.          int var22 = var13.height - (2 * this.oGapHeight + this.oBdrSize + 1);
  418.          this.innerSP.reshape(var16, var18, var20, var22);
  419.       } else {
  420.          Dimension var1;
  421.          Dimension var3;
  422.          if (this.sub1 == null) {
  423.             var3 = new Dimension(1, 1);
  424.             var1 = new Dimension(1, 1);
  425.          } else {
  426.             var3 = this.sub1.minimumSize();
  427.             var1 = this.sub1.preferredSize();
  428.          }
  429.  
  430.          Dimension var2;
  431.          Dimension var4;
  432.          if (this.sub2 == null) {
  433.             var4 = new Dimension(1, 1);
  434.             var2 = new Dimension(1, 1);
  435.          } else {
  436.             var4 = this.sub2.minimumSize();
  437.             var2 = this.sub2.preferredSize();
  438.          }
  439.  
  440.          this.dimChanged = false;
  441.          byte var5;
  442.          byte var6;
  443.          int var7;
  444.          int var8;
  445.          int var9;
  446.          int var10;
  447.          int var11;
  448.          int var12;
  449.          switch (this.splitType) {
  450.             case 0:
  451.                if (this.spComponent != null) {
  452.                   var5 = this.iBdrSize;
  453.                   var6 = this.iBdrSize;
  454.                   var9 = var13.width - 2 * this.iBdrSize;
  455.                   var10 = var13.height - 2 * this.iBdrSize;
  456.                   if (var9 < 0) {
  457.                      var9 = 0;
  458.                   }
  459.  
  460.                   if (var10 < 0) {
  461.                      var10 = 0;
  462.                   }
  463.  
  464.                   if (this.propResize) {
  465.                      this.spComponent.reshape(var5, var6, var9, var10);
  466.                   } else {
  467.                      this.spComponent.move(var5, var6);
  468.                   }
  469.  
  470.                   this.spComponent.layout();
  471.                   this.spComponent.invalidate();
  472.                   this.spComponent.validate();
  473.  
  474.                   try {
  475.                      this.spComponent.repaint();
  476.                      return;
  477.                   } catch (Exception var14) {
  478.                      ((Component)this).repaint();
  479.                      return;
  480.                   }
  481.                }
  482.  
  483.                return;
  484.             case 1:
  485.                var5 = 0;
  486.                var6 = 0;
  487.                var9 = this.optSize(var13.width, this.iGapWidth, var3.width, var4.width, var1.width, var2.width);
  488.                var10 = var13.height;
  489.                var7 = var9 + this.iGapWidth;
  490.                var8 = 0;
  491.                var11 = var13.width - var7;
  492.                var12 = var13.height;
  493.                break;
  494.             case 2:
  495.                var5 = 0;
  496.                var6 = 0;
  497.                var9 = var13.width;
  498.                var10 = this.optSize(var13.height, this.iGapHeight, var3.height, var4.height, var1.height, var2.height);
  499.                var7 = 0;
  500.                var8 = var10 + this.iGapHeight;
  501.                var11 = var13.width;
  502.                var12 = var13.height - var8;
  503.                break;
  504.             default:
  505.                return;
  506.          }
  507.  
  508.          if (this.heightOnly) {
  509.             this.heightOnly = false;
  510.             this.sub1.reshapeHeight(var6, var10);
  511.             this.sub2.reshapeHeight(var8, var12);
  512.          } else if (this.widthOnly) {
  513.             this.widthOnly = false;
  514.             this.sub1.reshapeWidth(var5, var9);
  515.             this.sub2.reshapeWidth(var7, var11);
  516.          } else {
  517.             this.sub1.reshape(var5, var6, var9, var10);
  518.             this.sub2.reshape(var7, var8, var11, var12);
  519.          }
  520.  
  521.          this.sub1.invalidate();
  522.          this.sub1.validate();
  523.          this.sub1.repaint();
  524.          this.sub2.invalidate();
  525.          this.sub2.validate();
  526.          this.sub2.repaint();
  527.       }
  528.    }
  529.  
  530.    public void moveSplit(int var1, int var2) {
  531.       if (this.isOuter) {
  532.          this.innerSP.moveSplit(var1, var2);
  533.       } else {
  534.          Dimension var5 = this.sub1.minimumSize();
  535.          Dimension var6 = this.sub2.minimumSize();
  536.          Rectangle var3 = new Rectangle(this.sub1.curLoc.x, this.sub1.curLoc.y, this.sub1.curDim.width, this.sub1.curDim.height);
  537.          Rectangle var4 = new Rectangle(this.sub2.curLoc.x, this.sub2.curLoc.y, this.sub2.curDim.width, this.sub2.curDim.height);
  538.          int var7 = var3.x;
  539.          int var8 = var3.y;
  540.          if (this.splitType == 2) {
  541.             if (var2 == 0) {
  542.                return;
  543.             }
  544.  
  545.             int var10;
  546.             int var14;
  547.             if (var2 > 0) {
  548.                if (this.enforceMinDim) {
  549.                   var14 = Math.max(var4.height - var2, var6.height);
  550.                } else {
  551.                   var14 = Math.max(var4.height - var2, 2 * this.iBdrSize);
  552.                }
  553.  
  554.                var10 = var3.height + var4.height - var14;
  555.             } else {
  556.                if (this.enforceMinDim) {
  557.                   var10 = Math.max(var3.height + var2, var5.height);
  558.                } else {
  559.                   var10 = Math.max(var3.height + var2, 2 * this.iBdrSize);
  560.                }
  561.  
  562.                var14 = var4.height + var3.height - var10;
  563.             }
  564.  
  565.             int var9 = var3.width;
  566.             int var13 = var4.width;
  567.             int var11 = var4.x;
  568.             int var12 = var4.y - var3.height + var10;
  569.             this.sub1.reshapeHeight(var8, var10);
  570.             this.sub2.reshapeHeight(var12, var14);
  571.          }
  572.  
  573.          if (this.splitType == 1) {
  574.             if (var1 == 0) {
  575.                return;
  576.             }
  577.  
  578.             int var15;
  579.             int var19;
  580.             if (var1 > 0) {
  581.                if (this.enforceMinDim) {
  582.                   var19 = Math.max(var4.width - var1, var6.width);
  583.                } else {
  584.                   var19 = Math.max(var4.width - var1, 2 * this.iBdrSize);
  585.                }
  586.  
  587.                var15 = var3.width + var4.width - var19;
  588.             } else {
  589.                if (this.enforceMinDim) {
  590.                   var15 = Math.max(var3.width + var1, var5.width);
  591.                } else {
  592.                   var15 = Math.max(var3.width + var1, this.iBdrSize);
  593.                }
  594.  
  595.                var19 = var4.width + var3.width - var15;
  596.             }
  597.  
  598.             int var16 = var3.height;
  599.             int var20 = var4.height;
  600.             int var18 = var4.y;
  601.             int var17 = var4.x - var3.width + var15;
  602.             this.sub1.reshapeWidth(var7, var15);
  603.             this.sub2.reshapeWidth(var17, var19);
  604.          }
  605.  
  606.          this.sub1.invalidate();
  607.          this.sub1.validate();
  608.          this.sub1.repaint();
  609.          this.sub2.invalidate();
  610.          this.sub2.validate();
  611.          this.sub2.repaint();
  612.       }
  613.    }
  614.  
  615.    public void update(Graphics var1) {
  616.       this.paint(var1);
  617.    }
  618.  
  619.    private void draw3DBdr(Graphics var1, int var2, int var3, int var4, int var5, int var6, Color var7, boolean var8) {
  620.       if (var6 >= 0) {
  621.          var1.setColor(this.use3dBdr ? var7 : var7.darker());
  622.  
  623.          for(int var9 = 0; var9 < var6; ++var9) {
  624.             if (this.use3dBdr) {
  625.                var1.draw3DRect(var2 + var9, var3 + var9, var4 - 2 * var9, var5 - 2 * var9, var8);
  626.             } else {
  627.                var1.drawRect(var2 + var9, var3 + var9, var4 - 2 * var9, var5 - 2 * var9);
  628.             }
  629.          }
  630.  
  631.       }
  632.    }
  633.  
  634.    public void paint(Graphics var1) {
  635.       if (this.dimChanged) {
  636.          this.placeComponents();
  637.       }
  638.  
  639.       Dimension var3 = ((Component)this).size();
  640.       Color var2 = ((Component)this).getBackground();
  641.       var1.setColor(var2);
  642.       if (this.isOuter) {
  643.          var1.setColor(this.gapColor);
  644.          var1.fillRect(0, 0, var3.width, var3.height);
  645.          this.draw3DBdr(var1, 0, 0, var3.width - 1, var3.height - 1, this.oBdrSize, this.gapColor, true);
  646.       } else if (this.splitType == 0) {
  647.          var1.setColor(var2);
  648.          var1.fillRect(0, 0, var3.width, var3.height);
  649.          this.draw3DBdr(var1, 0, 0, var3.width - 1, var3.height - 1, this.iBdrSize, this.gapColor, false);
  650.       } else {
  651.          var1.setColor(this.gapColor);
  652.          var1.fillRect(0, 0, var3.width, var3.height);
  653.       }
  654.  
  655.       super.paint(var1);
  656.    }
  657.  
  658.    public Component getComponent() {
  659.       return this.isOuter ? this.innerSP.getComponent() : this.spComponent;
  660.    }
  661.  
  662.    public Component[] getComponents() {
  663.       return null;
  664.    }
  665.  
  666.    private void propagateChanges() {
  667.       if (this.innerSP != null) {
  668.          this.propagateChangesSP(this.innerSP);
  669.          this.innerSP.propagateChanges();
  670.       }
  671.  
  672.       if (this.sub1 != null) {
  673.          this.propagateChangesSP(this.sub1);
  674.          this.sub1.propagateChanges();
  675.       }
  676.  
  677.       if (this.sub2 != null) {
  678.          this.propagateChangesSP(this.sub2);
  679.          this.sub2.propagateChanges();
  680.       }
  681.  
  682.    }
  683.  
  684.    private void propagateChangesSP(SplitterPanel var1) {
  685.       if (var1.oGapWidth != this.oGapWidth || var1.iGapWidth != this.iGapWidth || var1.oGapHeight != this.oGapWidth || var1.iGapHeight != this.iGapHeight || var1.iBdrSize != this.iBdrSize || var1.oBdrSize != this.oBdrSize || var1.use3dBdr != this.use3dBdr) {
  686.          this.dimChanged = true;
  687.          var1.dimChanged = true;
  688.       }
  689.  
  690.       var1.oGapWidth = this.oGapWidth;
  691.       var1.iGapWidth = this.iGapWidth;
  692.       var1.oGapHeight = this.oGapWidth;
  693.       var1.iGapHeight = this.iGapHeight;
  694.       var1.iBdrSize = this.iBdrSize;
  695.       var1.oBdrSize = this.oBdrSize;
  696.       var1.gapColor = this.gapColor;
  697.       var1.enforceMinDim = this.enforceMinDim;
  698.       var1.moveSplitCursor = this.moveSplitCursor;
  699.       var1.propResize = this.propResize;
  700.       var1.use3dBdr = this.use3dBdr;
  701.    }
  702.  
  703.    private Dimension maxDimOf(Dimension var1, Dimension var2) {
  704.       return new Dimension(Math.max(var1.width, var2.width), Math.max(var1.height, var2.height));
  705.    }
  706.  
  707.    public Dimension preferredSize() {
  708.       Dimension var1;
  709.       if (this.isOuter) {
  710.          var1 = new Dimension(this.innerSP.preferredSize());
  711.          var1.width += 2 * (this.oGapWidth + this.oBdrSize);
  712.          var1.height += 2 * (this.oGapHeight + this.oBdrSize);
  713.       } else if (this.splitType == 0) {
  714.          if (this.spComponent == null) {
  715.             var1 = new Dimension(0, 0);
  716.          } else {
  717.             var1 = new Dimension(this.spComponent.preferredSize());
  718.          }
  719.  
  720.          var1.width += 2 * this.iBdrSize;
  721.          var1.height += 2 * this.iBdrSize;
  722.       } else {
  723.          Dimension var2 = this.sub1.preferredSize();
  724.          Dimension var3 = this.sub2.preferredSize();
  725.          if (this.splitType == 2) {
  726.             var1 = new Dimension(var2.width, var2.height + var3.height);
  727.             var1.height += this.iGapHeight;
  728.          } else {
  729.             var1 = new Dimension(var2.width + var2.width, var2.height);
  730.             var1.width += this.iGapWidth;
  731.          }
  732.       }
  733.  
  734.       return this.maxDimOf(this.prefDim, var1);
  735.    }
  736.  
  737.    public Dimension minimumSize() {
  738.       Dimension var1;
  739.       if (this.isOuter) {
  740.          var1 = new Dimension(this.innerSP.minimumSize());
  741.          var1.width += 2 * (this.oGapWidth + this.oBdrSize);
  742.          var1.height += 2 * (this.oGapHeight + this.oBdrSize);
  743.       } else if (this.splitType == 0) {
  744.          if (this.spComponent == null) {
  745.             var1 = new Dimension(0, 0);
  746.          } else {
  747.             var1 = new Dimension(this.spComponent.minimumSize());
  748.          }
  749.  
  750.          var1.width += 2 * this.iBdrSize;
  751.          var1.height += 2 * this.iBdrSize;
  752.       } else {
  753.          Dimension var2 = this.sub1.minimumSize();
  754.          Dimension var3 = this.sub2.minimumSize();
  755.          if (this.splitType == 2) {
  756.             var1 = new Dimension(var2.width, var2.height + var3.height);
  757.             var1.height += this.iGapHeight;
  758.          } else {
  759.             var1 = new Dimension(var2.width + var2.width, var2.height);
  760.             var1.width += this.iGapWidth;
  761.          }
  762.       }
  763.  
  764.       return this.maxDimOf(this.minDim, var1);
  765.    }
  766.  
  767.    public void setPreferredSize(Dimension var1) {
  768.       this.prefDim.width = var1.width;
  769.       this.prefDim.height = var1.height;
  770.       this.prefDim = this.maxDimOf(var1, this.prefDim);
  771.       this.dimChanged = true;
  772.    }
  773.  
  774.    public void setMinimumSize(Dimension var1) {
  775.       this.minDim.width = var1.width;
  776.       this.minDim.height = var1.height;
  777.       this.prefDim = this.maxDimOf(var1, this.prefDim);
  778.       this.dimChanged = true;
  779.    }
  780.  
  781.    public synchronized void reshape(int var1, int var2, int var3, int var4) {
  782.       super.reshape(var1, var2, var3, var4);
  783.       if (this.curDim.width != var3 || this.curDim.height != var4 || this.curLoc.x != var1 || this.curLoc.y != var2) {
  784.          this.dimChanged = true;
  785.          this.curDim.width = var3;
  786.          this.curDim.height = var4;
  787.          this.curLoc.x = var1;
  788.          this.curLoc.y = var2;
  789.       }
  790.  
  791.    }
  792.  
  793.    public synchronized void reshapeWidth(int var1, int var2) {
  794.       Rectangle var3 = new Rectangle(this.curLoc.x, this.curLoc.y, this.curDim.width, this.curDim.height);
  795.       if (this.curDim.width != var2) {
  796.          this.dimChanged = true;
  797.          this.widthOnly = true;
  798.          this.curDim.width = var2;
  799.       }
  800.  
  801.       this.reshape(var1, var3.y, var2, var3.height);
  802.    }
  803.  
  804.    public synchronized void reshapeHeight(int var1, int var2) {
  805.       Rectangle var3 = new Rectangle(this.curLoc.x, this.curLoc.y, this.curDim.width, this.curDim.height);
  806.       if (this.curDim.height != var2) {
  807.          this.dimChanged = true;
  808.          this.heightOnly = true;
  809.          this.curDim.height = var2;
  810.       }
  811.  
  812.       this.reshape(var3.x, var1, var3.width, var2);
  813.    }
  814.  
  815.    public synchronized Component add(Component var1, int var2) {
  816.       if (var1 == null) {
  817.          return null;
  818.       } else if (this.isOuter) {
  819.          return this.innerSP.add(var1, var2);
  820.       } else {
  821.          if (this.spComponent != null) {
  822.             super.remove(this.spComponent);
  823.          }
  824.  
  825.          this.spComponent = super.add(var1, -1);
  826.          this.dimChanged = true;
  827.          return this.spComponent;
  828.       }
  829.    }
  830.  
  831.    public synchronized void remove(Component var1) {
  832.       if (this.isOuter) {
  833.          this.innerSP.remove(var1);
  834.       } else if (var1 == this.spComponent) {
  835.          this.spComponent = null;
  836.          super.remove(var1);
  837.       } else {
  838.          if (this.sub1 != null) {
  839.             this.sub1.remove(var1);
  840.          }
  841.  
  842.          if (this.sub2 != null) {
  843.             this.sub2.remove(var1);
  844.          }
  845.  
  846.       }
  847.    }
  848.  
  849.    public synchronized void removeAll() {
  850.       if (this.isOuter) {
  851.          this.innerSP.removeAll();
  852.       } else {
  853.          super.removeAll();
  854.          if (this.sub1 != null) {
  855.             super.add(this.sub1, -1);
  856.             this.sub1.removeAll();
  857.          }
  858.  
  859.          if (this.sub2 != null) {
  860.             super.add(this.sub2, -1);
  861.             this.sub1.removeAll();
  862.          }
  863.       }
  864.  
  865.       this.spComponent = null;
  866.    }
  867.  
  868.    public SplitterPanel split(int var1) {
  869.       return this.split(var1, (Component)null, (Component)null);
  870.    }
  871.  
  872.    public synchronized SplitterPanel split(int var1, Component var2, Component var3) {
  873.       if (this.isOuter) {
  874.          return this.innerSP.split(var1, var2, var3);
  875.       } else if (this.splitType != 0) {
  876.          return null;
  877.       } else if (var1 != 1 && var1 != 2) {
  878.          return null;
  879.       } else {
  880.          this.sub1 = new SplitterPanel(false);
  881.          if (this.sub1 == null) {
  882.             return null;
  883.          } else {
  884.             this.sub2 = new SplitterPanel(false);
  885.             if (this.sub2 == null) {
  886.                super.remove(this.sub1);
  887.                return null;
  888.             } else {
  889.                this.splitType = var1;
  890.                this.sub1.outerSP = this.outerSP;
  891.                this.sub2.outerSP = this.outerSP;
  892.                super.add(this.sub1, -1);
  893.                super.add(this.sub2, -1);
  894.                if (var2 != null) {
  895.                   this.sub1.add(var2);
  896.                }
  897.  
  898.                if (var3 != null) {
  899.                   this.sub2.add(var3);
  900.                }
  901.  
  902.                return this.sub1;
  903.             }
  904.          }
  905.       }
  906.    }
  907.  
  908.    public void setLayout(LayoutManager var1) {
  909.    }
  910.  
  911.    private Frame findFrame() {
  912.       Object var2 = this;
  913.       Class var3 = this.getClass();
  914.  
  915.       Class var1;
  916.       try {
  917.          var1 = Class.forName("java.awt.Frame");
  918.       } catch (ClassNotFoundException var4) {
  919.          return null;
  920.       }
  921.  
  922.       while(var2 != null) {
  923.          var2 = ((Component)var2).getParent();
  924.  
  925.          for(var3 = var2.getClass(); var3 != var1 && var3 != null; var3 = var3.getSuperclass()) {
  926.          }
  927.  
  928.          if (var3 == var1) {
  929.             return (Frame)var2;
  930.          }
  931.       }
  932.  
  933.       return null;
  934.    }
  935.  
  936.    private void resetCursor() {
  937.       if (this.outerSP.cursorChanged) {
  938.          Frame var1 = this.findFrame();
  939.          if (var1 != null) {
  940.             try {
  941.                var1.setCursor(0);
  942.                this.outerSP.cursorChanged = false;
  943.             } catch (IllegalArgumentException var2) {
  944.             }
  945.          }
  946.       }
  947.    }
  948.  
  949.    private int setCursor(int var1) {
  950.       if (this.outerSP.cursorChanged) {
  951.          return var1;
  952.       } else if (!this.isOuter) {
  953.          return this.outerSP.setCursor(var1);
  954.       } else {
  955.          Frame var2 = this.findFrame();
  956.          if (var2 == null) {
  957.             return Integer.MIN_VALUE;
  958.          } else {
  959.             try {
  960.                var2.setCursor(var1);
  961.                this.cursorChanged = true;
  962.                return var1;
  963.             } catch (IllegalArgumentException var3) {
  964.                return Integer.MIN_VALUE;
  965.             }
  966.          }
  967.       }
  968.    }
  969.  
  970.    private boolean inComponent(Component var1, int var2, int var3) {
  971.       Point var4 = var1.location();
  972.       return var1.inside(var2 - var4.x, var3 - var4.y);
  973.    }
  974.  
  975.    private boolean inGap(Event var1) {
  976.       return this.inGap(var1.x, var1.y);
  977.    }
  978.  
  979.    private boolean inGap(int var1, int var2) {
  980.       if (this.inGap1(var1, var2)) {
  981.          return true;
  982.       } else if (this.isOuter) {
  983.          return this.innerSP.inGap(var1 - this.innerSP.curLoc.x, var2 - this.innerSP.curLoc.y);
  984.       } else if (this.splitType != 2 && this.splitType != 1) {
  985.          return false;
  986.       } else {
  987.          return this.sub1.inGap(var1 - this.sub1.curLoc.x, var2 - this.sub1.curLoc.y) || this.sub2.inGap(var1 - this.sub2.curLoc.x, var2 - this.sub2.curLoc.y);
  988.       }
  989.    }
  990.  
  991.    private boolean inGap1(int var1, int var2) {
  992.       if (!((Component)this).inside(var1, var2)) {
  993.          return false;
  994.       } else if (this.isOuter) {
  995.          return false;
  996.       } else if (this.splitType != 2 && this.splitType != 1) {
  997.          return false;
  998.       } else {
  999.          return !this.inComponent(this.sub1, var1, var2) && !this.inComponent(this.sub2, var1, var2);
  1000.       }
  1001.    }
  1002.  
  1003.    public boolean oGapThis(Event var1) {
  1004.       if (!this.doMoveSplit && !this.inGap(var1)) {
  1005.          this.resetCursor();
  1006.       }
  1007.  
  1008.       return true;
  1009.    }
  1010.  
  1011.    public String toString() {
  1012.       String var1 = "Bad Panel ";
  1013.       if (this.isOuter) {
  1014.          var1 = "Outer ";
  1015.       } else {
  1016.          if (this.splitType == 0) {
  1017.             var1 = "Unsplit ";
  1018.          }
  1019.  
  1020.          if (this.splitType == 1) {
  1021.             var1 = "Vertically split ";
  1022.          }
  1023.  
  1024.          if (this.splitType == 2) {
  1025.             var1 = "Horizontally split ";
  1026.          }
  1027.       }
  1028.  
  1029.       Container var2 = ((Component)this).getParent();
  1030.       String var3;
  1031.       if (var2 == null) {
  1032.          var3 = " with no parent (not added)";
  1033.       } else {
  1034.          var3 = " with parent @" + var2.hashCode();
  1035.       }
  1036.  
  1037.       return var1 + super.toString() + ": @" + this.hashCode() + var3;
  1038.    }
  1039. }
  1040.